package com.lebang.feign.draw;

import com.lebang.model.RequestUserInfo;
import com.lebang.feign.draw.fallback.DrawAwardFallback;
import com.lebangweb.response.JsonData;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author xwj
 */
@FeignClient(name = "wangzhuan-draw", contextId = "wangzhuan-draw-award", fallback = DrawAwardFallback.class)
public interface DrawAwardFeign {

    /**
     * 中奖记录--app
     *
     * @return 返回结果
     */
    @ApiOperation("中奖记录")
    @PostMapping("/draw/drawawardrecord/award")
    JsonData award(@RequestBody RequestUserInfo request, @RequestParam(value = "status", required = false) Integer status);

    /**
     * 用户收货信息--app
     *
     * @return 返回结果
     */
    @ApiOperation("用户收货信息")
    @PostMapping("/draw/drawawardrecord/info")
    JsonData info(@RequestBody RequestUserInfo request,
                  @RequestParam(value = "nickname", required = false) String nickname,
                  @RequestParam(value = "phone", required = false) Integer phone,
                  @RequestParam(value = "awardAdress", required = false) String awardAdress,
                  @RequestParam(value = "message", required = false) String message,
                  @RequestParam(value = "id", required = false) Integer id);

    /**
     * 抽奖--app
     *
     * @return 返回结果
     */
    @ApiOperation("抽奖")
    @PostMapping("/draw/drawawardrecord/draw")
    JsonData draw(@RequestBody RequestUserInfo request);

    /**
     * 今日剩余抽奖次数--app
     *
     * @return 返回结果
     */
    @ApiOperation("今日剩余抽奖次数")
    @PostMapping("/draw/drawawardrecord/drawtimes")
    JsonData drawtimes(@RequestBody RequestUserInfo userInfo);
}
